package com.schoolET.service.admin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.schoolET.entity.News;
import com.baomidou.mybatisplus.extension.service.IService;
import com.schoolET.entity.dto.NewsDTO;
import com.schoolET.entity.vo.AddNewsVO;
import com.schoolET.entity.vo.NewsInfoVO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * <p>
 * 新闻 服务类
 * </p>
 *
 * @author lin
 * @since 2024-06-02
 */
public interface INewsService extends IService<News> {

    /**
     * @description: 查询新闻
     * @author: lin
     * @date: 2024/6/3 20:40
     * @param: newsInfoVO
     * @return: Page<NewsDTO>
     **/
    Page<NewsDTO> getNewsList(NewsInfoVO newsInfoVO);

    /**
     * @description: 添加新闻
     * @author: lin
     * @date: 2024/6/3 20:41
     * @param: addNewsVO
     * @param: openId
     * @param: file
     * @return: boolean
     **/
    boolean addNews(AddNewsVO addNewsVO, Integer adminId, MultipartFile file) throws IOException;

    /**
     * @description: 通过id获取新闻信息
     * @author: lin
     * @date: 2024/6/11 10:30
     * @param: id
     * @return: NewsDTO
     **/
    NewsDTO getNewsInfoById(Integer id);

    /**
     * @description: 通过用户openId查询用户区域新闻
     * @author: lin
     * @date: 2024/6/14 15:37
     * @param: pageNum
     * @param: pageSize
     * @param: openId
     * @return: NewsDTO
     **/
    Page<NewsDTO> getNewsByOpenId(Integer pageNum, Integer pageSize, String openId);


    /**
     * @description: 通过二级管理员的的id查找该区域的新闻
     * @author: lin
     * @date: 2024/6/17 18:52
     * @param: pageNum
     * @param: pageSize
     * @param: adminId
     * @return: Page<NewsDTO>
     **/
    Page<NewsDTO> getNewsByAdminId(Integer pageNum, Integer pageSize, Integer adminId);

}
